package com.zhisheng.mapper;

import com.zhisheng.pojo.Emp;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 员工管理
 */
@Mapper
public interface EmpMapper {

/*    @Select("select * from emp limit #{start},#{pageSize}")
    List<Emp> getByPage(@Param("start") Integer start, @Param("pageSize")Integer pageSize);

    @Select("select count(*) from emp")
    Long getTotal();*/
    //分页插件实现
    @Select("select * from emp")
    public List<Emp> getByPage();
    @Insert("insert into emp values (null,#{username},#{password},#{name},#{gender},#{image},#{job},#{entrydate},#{deptId},#{createTime},#{updateTime})")
    int insert(Emp emp);
    @Update("update emp set username=#{username},password=#{password},name=#{name},gender=#{gender},image=#{image},job=#{job},entrydate=#{entrydate},dept_id=#{deptId},update_time=#{updateTime} where id=#{id}")
    int update(Emp emp);
}
